You can not watch the Post Because You are a Visitor
If you have already an account at Card Mafia Do log in as Member
To complete & You can register a new account
Totally FREE--
click Here )
Useful links : Invite Your Friends | Recover password | Advertising in CM | Join Carding Class
You can not watch the Post Because You are a Visitor
If you have already an account at Card Mafia Do log in as Member
To complete & You can register a new account
Totally FREE--
click Here )
|
The link is dead
Getting the MAC Address and Generating the Serial Number
The first step is to get the MAC address of the client's machine. This could be achieved by using the ManagementClass class located in the System.Management assembly. We have to add a reference to that assembly to our project, and import it into SecurityManager.vb, which will be the class in which we place the GetSerial() and CheckKey() functions. These two functions will be responsible for generating the serial number from the MAC address and checking whether the key entered by the user is valid. As a first step, we define the GetSerial() function as follows:
This function will give us the unique serial number of each MAC address (not totally unique, but similar to hash function uniqueness).Code:Public Function GetSerial() As Long Dim mc As New ManagementClass("Win32_NetworkAdapterConfiguration") Dim mac As String = "" 'Getting network adapters collection Dim moc As ManagementObjectCollection = mc.GetInstances 'Here we iterate over available network adapters, 'picking the first possible one For Each mo As ManagementObject In moc If mo.Item("IPEnabled") Then mac = mo.Item("MacAddress").ToString Exit For End If Next mc.Dispose() 'This is a simple function that we use to get a serial out 'of our MAC address. Say that x is the MAC and y is the serial, 'the function would be y += x[i] + (i * 2) where i is the index 'of MAC address element. Dim sum As Long = 0 Dim index As Integer = 1 For Each ch As Char In mac If Char.IsDigit(ch) Then sum += sum + Integer.Parse(ch) * (index * 2) ElseIf Char.IsLetter(ch) Then Select Case ch.ToString.ToUpper Case "A" sum += sum + 10 * (index * 2) Case "B" sum += sum + 11 * (index * 2) Case "C" sum += sum + 12 * (index * 2) Case "D" sum += sum + 13 * (index * 2) Case "E" sum += sum + 14 * (index * 2) Case "F" sum += sum + 15 * (index * 2) End Select End If index += 1 Next Return sum End Function
Generating Activation Key from the Serial Number
The second step is to create the key generator which will generate the activation key from a given serial number. This generator will be placed in a class called KeyGenerator. This class will contain a function which will apply a simple mathematical function on the serial number to get the activation key. In this case, I will use the function f(x) = x2 + 53/x + 113 * (x/4).
Back to SecurityManager.vb, we need to add one more function, which is CheckKey(). This function will take the activation key as a parameter, apply the key-generating function on the current MAC address, then compare the two keys to see whether they match or not.Code:Public Class KeyGenerator Public Function GenerateKey(ByVal serial As Long) As Long Dim x As Long = serial Return x * x + 53 / x + 113 * (x / 4) End Function End Class
One important note left: do not place all of these classes in your client's solution! Remember that the key-generating class is only owned by you.Code:Public Function CheckKey(ByVal key As Long) As Boolean Dim x As Long = GetSerial() Dim y As Long = x * x + 53 / x + 113 * (x / 4) Return y = key End Function
Happy coding!
thank u men
link is dead.................
like where
Bookmarks